<template>
    <div>
        <h2>homework</h2>
        <table border="1">
            <tbody>
                <tr>
                <td>Id</td>
                <td>name</td>
                <td>age</td>
                <td>img</td>
                <td>生日</td>
                <td>性别</td>
                </tr>
                <tr v-for="item in data" :key="item.id">
                    <td>{{ item.id }}</td>
                    <td>{{ item.name }}</td>
                    <td >{{ item.age }}</td>
                    <td >
                        <img v-bind:src="item.img" alt="" width="100px" height="100px">
                    </td>
                    <td>{{ moment(item.birth).format('YYYY-MM-DD hh:mm:ss') }}</td>
                    <td >{{ item.sex==1?'男':'女' }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'
import moment from 'moment';

let data=ref([
    {   id:1,
        name:'宋宝子',
        age:40,
        img:"https://img1.baidu.com/it/u=3776951402,188974010&fm=253&fmt=auto?w=1026&h=665",
        birth:'2022-09-20T11:32:09.244927',
        sex:1,
    },
    {   id:2,
        name:'baobao',
        age:23,
        img:"https://img1.baidu.com/it/u=3776951402,188974010&fm=253&fmt=auto?w=1026&h=665",
        birth:'2022-09-20T11:32:09.244927',
        sex:0,
    },
    {   id:3,
        name:'梅梅',
        age:12,
        img:"https://img1.baidu.com/it/u=3776951402,188974010&fm=253&fmt=auto?w=1026&h=665",
        birth:'2022-09-20T11:32:09.244927',
        sex:1,
    },
])
</script>

<style scoped>

</style>